package com.wooophone.buyi.dao.impl;

import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;

import com.wooophone.buyi.bean.OAuth;
import com.wooophone.buyi.dao.OAuthDao;

public class OAuthDaoImpl extends BaseDaoImpl<OAuth> implements OAuthDao {
	
	public OAuthDaoImpl() {
		super(OAuth.class);
	}

	public void deleteBySessionId(String sessionId) {
		mongoOperations.remove(
				Query.query(Criteria.where("sessionId").is(sessionId)),
				entityClass);
	}

	public OAuth getBySessionId(String sessionId) {
		OAuth oAuth=super.isResult("sessionId", sessionId);
		return oAuth;
	}

	public void setMongoOperations(MongoOperations mongoOperations) {
		super.mongoOperations=mongoOperations;
	}
}
